package com.ly.demo.weixin.rsp;

import lombok.Data;

/**
 * @author: liuyang
 * @date: 2024/1/15 13:57
 */
@Data
public class WeixinBaseRsp {

    public static final Integer SUCCESS_CODE = 0;

    /**
     * 错误信息
     */
    protected String errmsg;
    /**
     * 错误码
     */
    protected Integer errcode;

    /**
     * 是否成功
     * @return
     */
    public boolean isSuccess() {
       return errcode == null || SUCCESS_CODE.equals(errcode);
    }

    /**
     * 是否失败
     * @return
     */
    public boolean isFail() {
        return !this.isSuccess();
    }
}
